package org.jflame.context.spring;

import org.jflame.commons.config.ConfigReader;

import org.springframework.core.env.Environment;

/**
 * 从spring配置获取参数配置,继承BaseParamStrategy方便类型转换
 * 
 * @author charles.zhang
 */
public class SpringPropertiesConfig extends ConfigReader {

    private Environment env;

    public SpringPropertiesConfig(Environment env) {
        this.env = env;
    }

    @Override
    public boolean hasKey(String configKey) {
        return env.getProperty(configKey) != null;
    }

    @Override
    public String getValue(String configKey) {
        return env.getProperty(configKey);
    }

}
